# 导包
import jsonschema
# 准备被测数据
data = {
    "message": "操作成功!",
    "mobile": "13800000002"
}
# 编写schema
schema = {
    "type": "object",
    "properties": {
        "message": {"pattern": "操作成功"},
        "mobile": {"pattern": "^[0-9]{11}$"}
    }
}


# 调用validate校验数据
result = jsonschema.validate(instance=data, schema=schema)
print(result)